翻訳と辞書
Words near each other
・ Fibiș
・ Fibiș River
・ Fibla carpenteri
・ FIBO Power Pro Germany
・ Fibonacci
・ Fibonacci coding
・ Fibonacci cube
・ Fibonacci heap
・ Fibonacci number
・ Fibonacci numbers in popular culture
・ Fibonacci polynomials
・ Fibonacci prime
・ Fibonacci Quarterly
・ Fibonacci quasicrystal
・ Fibonacci retracement
Fibonacci search technique
・ Fibonacci word
・ Fibonacci's identity
・ Fibonomial coefficient
・ Fibonorial
・ Fiborgtangen
・ FIBP
・ Fibra
・ Fibra óptica
・ Fibramia
・ Fibramia thermalis
・ Fibrant object
・ Fibras Industriales S.A.
・ Fibrate
・ Fibration


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Fibonacci search technique : ウィキペディア英語版
Fibonacci search technique

In computer science, the Fibonacci search technique is a method of searching a sorted array using a divide and conquer algorithm that narrows down possible locations with the aid of Fibonacci numbers.
Compared to binary search, Fibonacci search examines
locations whose addresses have lower dispersion. Therefore, when the elements being searched have non-uniform access memory storage (i.e., the time needed to access a storage location
varies depending on the location previously accessed), the Fibonacci search has an
advantage over binary search in slightly reducing the average time needed to access
a storage location. The typical example of non-uniform access storage is that of
a magnetic tape, where the time to access a particular element is proportional to
its distance from the element currently under the tape's head. Note, however, that large arrays
not fitting in CPU cache or even in RAM can also be considered as non-uniform access examples.
Fibonacci search has a complexity of ''O''(log(''n'')) (see Big O notation).
Fibonacci search was first devised by Jack Kiefer (1953) as a minimax search for the maximum (minimum) of a unimodal function in an interval.
==Algorithm==

Let ''k'' be defined as an element in ''F'', the array of Fibonacci numbers. ''n'' = ''Fm'' is the array size. If the array size is not a Fibonacci number, let ''Fm'' be the smallest number in ''F'' that is greater than ''n''.
The array of Fibonacci numbers is defined where ''F''''k''+2 = ''F''''k''+1 + ''Fk'', when ''k'' ≥ 0, ''F''1 = 1, and ''F0'' = 0.
To test whether an item is in the list of ordered numbers, follow these steps:
#Set ''k'' = ''m''.
#If ''k'' = 0, stop. There is no match; the item is not in the array.
#Compare the item against element in ''F''''k''−1.
#If the item matches, stop.
#If the item is less than entry ''F''''k''−1, discard the elements from positions ''F''''k''−1 + 1 to ''n''. Set ''k'' = ''k'' − 1 and return to step 2.
#If the item is greater than entry ''F''''k''−1, discard the elements from positions 1 to ''F''''k''−1. Renumber the remaining elements from 1 to ''F''''k''−2, set ''k'' = ''k'' − 2, and return to step 2.
Alternative implementation (from "Sorting and Searching" by Knuth):
Given a table of records ''R1'', ''R2'', ..., ''RN'' whose keys are in increasing order ''K1'' < ''K2'' < ... < ''KN'', the algorithm searches for a given argument ''K''. Assume ''N+1'' = ''F''''k''+1
Step 1. () ''i'' ← ''F''''k'', ''p'' ← ''F''''k''-1, ''q'' ← ''F''''k''-2 (throughout the algorithm, ''p'' and ''q'' will be consecutive Fibonacci numbers)
Step 2. () If ''K'' < ''Ki'', go to ''Step 3''; if ''K'' > ''Ki'' go to ''Step 4''; and if ''K'' = ''Ki'', the algorithm terminates successfully.
Step 3. (''i'' ) If ''q''=0, the algorithm terminates unsuccessfully. Otherwise set (''i'', ''p'', ''q'') ← (''p'', ''q'', ''p - q'') (which moves ''p'' and ''q'' one position back in the Fibonacci sequence); then return to ''Step 2''
Step 4. (''i'' ) If ''p''=1, the algorithm terminates unsuccessfully. Otherwise set (''i'',''p'',''q'') ← (''i + q'', ''p - q'', ''2q - p'') (which moves ''p'' and ''q'' two positions back in the Fibonacci sequence); and return to ''Step 2''

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Fibonacci search technique」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.